Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): Update Go deps with critical/high CVEs #101

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hairyhenderson
Copy link
Contributor

@hairyhenderson hairyhenderson commented Jun 27, 2024

Note: this depends on #100 being merged first


There are a number of outdated dependencies with high and critical CVEs, which trip up scanners, not to mention the potential risk. I've scanned the go.mod with Trivy and updated affected packages until it scans clean. Here's the initial scan:

$ trivy fs --severity=HIGH,CRITICAL .
2024-06-27T08:24:44-04:00       INFO    Vulnerability scanning is enabled
2024-06-27T08:24:44-04:00       INFO    Secret scanning is enabled
2024-06-27T08:24:44-04:00       INFO    If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-06-27T08:24:44-04:00       INFO    Please see also https://aquasecurity.github.io/trivy/v0.52/docs/scanner/secret/#recommendation for faster secret detection
2024-06-27T08:24:45-04:00       INFO    Number of language-specific files       num=1
2024-06-27T08:24:45-04:00       INFO    [gomod] Detecting vulnerabilities...

go.mod (gomod)

Total: 7 (HIGH: 6, CRITICAL: 1)

┌────────────────────────────────┬─────────────────────┬──────────┬────────┬───────────────────┬────────────────────────┬──────────────────────────────────────────────────────────────┐
│            Library             │    Vulnerability    │ Severity │ Status │ Installed Version │     Fixed Version      │                            Title                             │
├────────────────────────────────┼─────────────────────┼──────────┼────────┼───────────────────┼────────────────────────┼──────────────────────────────────────────────────────────────┤
│ github.com/cloudflare/circl    │ GHSA-9763-4f94-gfch │ HIGH     │ fixed  │ 1.3.1             │ 1.3.7                  │ CIRCL's Kyber: timing side-channel (kyberslash2)             │
│                                │                     │          │        │                   │                        │ https://github.com/advisories/GHSA-9763-4f94-gfch            │
├────────────────────────────────┼─────────────────────┼──────────┤        ├───────────────────┼────────────────────────┼──────────────────────────────────────────────────────────────┤
│ github.com/go-git/go-git/v5    │ CVE-2023-49569      │ CRITICAL │        │ 5.5.1             │ 5.11.0                 │ go-git: Maliciously crafted Git server replies can lead to   │
│                                │                     │          │        │                   │                        │ path traversal and...                                        │
│                                │                     │          │        │                   │                        │ https://avd.aquasec.com/nvd/cve-2023-49569                   │
│                                ├─────────────────────┼──────────┤        │                   │                        ├──────────────────────────────────────────────────────────────┤
│                                │ CVE-2023-49568      │ HIGH     │        │                   │                        │ go-git: Maliciously crafted Git server replies can cause DoS │
│                                │                     │          │        │                   │                        │ on go-git clients...                                         │
│                                │                     │          │        │                   │                        │ https://avd.aquasec.com/nvd/cve-2023-49568                   │
├────────────────────────────────┼─────────────────────┤          │        ├───────────────────┼────────────────────────┼──────────────────────────────────────────────────────────────┤
│ github.com/opencontainers/runc │ CVE-2023-27561      │          │        │ 1.1.4             │ 1.1.5                  │ runc: volume mount race condition (regression of             │
│                                │                     │          │        │                   │                        │ CVE-2019-19921)                                              │
│                                │                     │          │        │                   │                        │ https://avd.aquasec.com/nvd/cve-2023-27561                   │
│                                ├─────────────────────┤          │        │                   ├────────────────────────┼──────────────────────────────────────────────────────────────┤
│                                │ CVE-2024-21626      │          │        │                   │ 1.1.12                 │ runc: file descriptor leak                                   │
│                                │                     │          │        │                   │                        │ https://avd.aquasec.com/nvd/cve-2024-21626                   │
├────────────────────────────────┼─────────────────────┤          │        ├───────────────────┼────────────────────────┼──────────────────────────────────────────────────────────────┤
│ golang.org/x/net               │ CVE-2023-39325      │          │        │ 0.7.0             │ 0.17.0                 │ golang: net/http, x/net/http2: rapid stream resets can cause │
│                                │                     │          │        │                   │                        │ excessive work (CVE-2023-44487)                              │
│                                │                     │          │        │                   │                        │ https://avd.aquasec.com/nvd/cve-2023-39325                   │
├────────────────────────────────┼─────────────────────┤          │        ├───────────────────┼────────────────────────┼──────────────────────────────────────────────────────────────┤
│ google.golang.org/grpc         │ GHSA-m425-mq94-257g │          │        │ 1.51.0            │ 1.56.3, 1.57.1, 1.58.3 │ gRPC-Go HTTP/2 Rapid Reset vulnerability                     │
│                                │                     │          │        │                   │                        │ https://github.com/advisories/GHSA-m425-mq94-257g            │
└────────────────────────────────┴─────────────────────┴──────────┴────────┴───────────────────┴────────────────────────┴──────────────────────────────────────────────────────────────┘

@tianon
Copy link
Member

tianon commented Jun 27, 2024

Have you checked whether any of these apply to our actual codepaths via govulncheck?

@yosifkit
Copy link
Member

Checking a freshly built bashbrew binary built with golang:1.20-bullseye (and then govulncheck in golang:1.22-bookworm):

root@4283178c24dd:/app# govulncheck -mode=binary ./bin/bashbrew
=== Symbol Results ===

Vulnerability #1: GO-2024-2887
    Unexpected behavior from Is methods for IPv4-mapped IPv6 addresses in
    net/netip
  More info: https://pkg.go.dev/vuln/GO-2024-2887
  Standard library
    Found in: net/[email protected]
    Fixed in: net/[email protected]
    Vulnerable symbols found:
      #1: netip.Addr.IsGlobalUnicast
      #2: netip.Addr.IsInterfaceLocalMulticast
      #3: netip.Addr.IsLinkLocalMulticast
      #4: netip.Addr.IsLoopback
      #5: netip.Addr.IsMulticast
      Use '-show traces' to see the other 1 found symbols

Vulnerability #2: GO-2024-2687
    HTTP/2 CONTINUATION flood in net/http
  More info: https://pkg.go.dev/vuln/GO-2024-2687
  Module: golang.org/x/net
    Found in: golang.org/x/[email protected]
    Fixed in: golang.org/x/[email protected]
    Vulnerable symbols found:
      #1: http2.ConnectionError.Error
      #2: http2.ErrCode.String
      #3: http2.FrameHeader.String
      #4: http2.FrameType.String
      #5: http2.Framer.ReadFrame
      Use '-show traces' to see the other 22 found symbols

  Standard library
    Found in: net/[email protected]
    Fixed in: net/[email protected]
    Vulnerable symbols found:
      #1: http.CanonicalHeaderKey
      #2: http.Client.CloseIdleConnections
      #3: http.Client.Do
      #4: http.Client.Get
      #5: http.Client.Head
      Use '-show traces' to see the other 108 found symbols

Vulnerability #3: GO-2024-2610
    Errors returned from JSON marshaling may break template escaping in
    html/template
  More info: https://pkg.go.dev/vuln/GO-2024-2610
  Standard library
    Found in: html/[email protected]
    Fixed in: html/[email protected]
    Vulnerable symbols found:
      #1: template.Template.Execute
      #2: template.Template.ExecuteTemplate

Vulnerability #4: GO-2024-2600
    Incorrect forwarding of sensitive headers and cookies on HTTP redirect in
    net/http
  More info: https://pkg.go.dev/vuln/GO-2024-2600
  Standard library
    Found in: net/[email protected]
    Fixed in: net/[email protected]
    Vulnerable symbols found:
      #1: http.Client.Do
      #2: http.Client.Get
      #3: http.Client.Head
      #4: http.Client.Post
      #5: http.Client.PostForm
      Use '-show traces' to see the other 1 found symbols

Vulnerability #5: GO-2024-2599
    Memory exhaustion in multipart form parsing in net/textproto and net/http
  More info: https://pkg.go.dev/vuln/GO-2024-2599
  Standard library
    Found in: net/[email protected]
    Fixed in: net/[email protected]
    Vulnerable symbols found:
      #1: textproto.Reader.ReadLine
      #2: textproto.Reader.ReadMIMEHeader

Vulnerability #6: GO-2024-2598
    Verify panics on certificates with an unknown public key algorithm in
    crypto/x509
  More info: https://pkg.go.dev/vuln/GO-2024-2598
  Standard library
    Found in: crypto/[email protected]
    Fixed in: crypto/[email protected]
    Vulnerable symbols found:
      #1: x509.Certificate.Verify

Vulnerability #7: GO-2024-2466
    Denial of service in github.com/go-git/go-git/v5 and
    gopkg.in/src-d/go-git.v4
  More info: https://pkg.go.dev/vuln/GO-2024-2466
  Module: github.com/go-git/go-git/v5
    Found in: github.com/go-git/go-git/[email protected]
    Fixed in: github.com/go-git/go-git/[email protected]
    Vulnerable symbols found:
      #1: config.Branch.Validate
      #2: config.Config.Unmarshal
      #3: config.Config.Validate
      #4: config.LoadConfig
      #5: config.ReadConfig
      Use '-show traces' to see the other 30 found symbols

Vulnerability #8: GO-2024-2456
    Path traversal and RCE in github.com/go-git/go-git/v5 and
    gopkg.in/src-d/go-git.v4
  More info: https://pkg.go.dev/vuln/GO-2024-2456
  Module: github.com/go-git/go-git/v5
    Found in: github.com/go-git/go-git/[email protected]
    Fixed in: github.com/go-git/go-git/[email protected]
    Vulnerable symbols found:
      #1: config.Branch.Validate
      #2: config.Config.Unmarshal
      #3: config.Config.Validate
      #4: config.LoadConfig
      #5: config.ReadConfig
      Use '-show traces' to see the other 30 found symbols

Vulnerability #9: GO-2023-2402
    Man-in-the-middle attacker can compromise integrity of secure channel in
    golang.org/x/crypto
  More info: https://pkg.go.dev/vuln/GO-2023-2402
  Module: golang.org/x/crypto
    Found in: golang.org/x/[email protected]
    Fixed in: golang.org/x/[email protected]
    Vulnerable symbols found:
      #1: ssh.Client.Dial
      #2: ssh.Client.DialTCP
      #3: ssh.Client.Listen
      #4: ssh.Client.ListenTCP
      #5: ssh.Client.ListenUnix
      Use '-show traces' to see the other 43 found symbols

Vulnerability #10: GO-2023-2153
    Denial of service from HTTP/2 Rapid Reset in google.golang.org/grpc
  More info: https://pkg.go.dev/vuln/GO-2023-2153
  Module: google.golang.org/grpc
    Found in: google.golang.org/[email protected]
    Fixed in: google.golang.org/[email protected]
    Vulnerable symbols found:
      #1: grpc.Server.Serve
      #2: transport.NewServerTransport

Your code is affected by 10 vulnerabilities from 3 modules and the Go standard library.
This scan also found 2 vulnerabilities in packages you import and 6
vulnerabilities in modules you require, but your code doesn't appear to call
these vulnerabilities.
Use '-show verbose' for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants